<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    50. Pow(x, n)
   </h1>
   <p>
    Implement
    <a href="http://www.cplusplus.com/reference/valarray/pow/" target="_blank">
     pow(
     <em>
      x
     </em>
     ,
     <em>
      n
     </em>
     )
    </a>
    , which calculates&nbsp;
    <em>
     x
    </em>
    raised to the power
    <em>
     n
    </em>
    (x
    <sup>
     <span style="font-size:10.8333px">
      n
     </span>
    </sup>
    ).
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 2.00000, 10
<strong>Output:</strong> 1024.00000
</pre>
   <p>
    <strong>
     Example 2:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 2.10000, 3
<strong>Output:</strong> 9.26100
</pre>
   <p>
    <strong>
     Example 3:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 2.00000, -2
<strong>Output:</strong> 0.25000
<strong>Explanation:</strong> 2<sup>-2</sup> = 1/2<sup>2</sup> = 1/4 = 0.25
</pre>
   <p>
    <strong>
     Note:
    </strong>
   </p>
   <ul>
    <li>
     -100.0 &lt;
     <em>
      x
     </em>
     &lt; 100.0
    </li>
    <li>
     <em>
      n
     </em>
     is a 32-bit signed integer, within the range&nbsp;[&minus;2
     <sup>
      31
     </sup>
     ,&nbsp;2
     <sup>
      31&nbsp;
     </sup>
     &minus; 1]
    </li>
   </ul>
  </div>
  <div>
   <h1 class="question_title">
    50. Pow(x, n)
   </h1>
   <p>
    实现&nbsp;
    <a href="https://www.cplusplus.com/reference/valarray/pow/" target="_blank">
     pow(
     <em>
      x
     </em>
     ,
     <em>
      n
     </em>
     )
    </a>
    &nbsp;，即计算 x 的 n 次幂函数。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre><strong>输入:</strong> 2.00000, 10
<strong>输出:</strong> 1024.00000
</pre>
   <p>
    <strong>
     示例&nbsp;2:
    </strong>
   </p>
   <pre><strong>输入:</strong> 2.10000, 3
<strong>输出:</strong> 9.26100
</pre>
   <p>
    <strong>
     示例&nbsp;3:
    </strong>
   </p>
   <pre><strong>输入:</strong> 2.00000, -2
<strong>输出:</strong> 0.25000
<strong>解释:</strong> 2<sup>-2</sup> = 1/2<sup>2</sup> = 1/4 = 0.25</pre>
   <p>
    <strong>
     说明:
    </strong>
   </p>
   <ul>
    <li>
     -100.0 &lt;&nbsp;
     <em>
      x
     </em>
     &nbsp;&lt; 100.0
    </li>
    <li>
     <em>
      n
     </em>
     &nbsp;是 32 位有符号整数，其数值范围是&nbsp;[&minus;2
     <sup>
      31
     </sup>
     ,&nbsp;2
     <sup>
      31&nbsp;
     </sup>
     &minus; 1] 。
    </li>
   </ul>
  </div>
 </body>
</html>